#include <iostream>

using std::cout;
using std::endl;

class A
{
public:
    A(int a = 0): _a(a) {   cout << "A(int = 0)" << endl;   }

    void print() const 
    {   cout << "_a:" << _a << endl;    }

private:
    long _a;
};

class B
: public A
{
public:
    B(long a, long b)
    : A(a), _b(b)
    {   cout << "B(long,long)" << endl; }
private:
    long _b;
};

class C
: public A
{
public:
    C(long a, long c)
    : A(a), _c(c)
    {   cout << "C(long,long)" << endl; }
private:
    long _c;
};

class D
: public B
, public C
{
public:
    D(long a1, long a2, long b, long c, long d)
    : B(a1, b)
    , C(a2, c)
    , _d(d)
    {   cout << "D()" << endl;  }
private:
    long _d;
};

int main()
{
    D d(1, 2, 3, 4, 5);
    //d.print();//error
    //d.A::print();//error
    d.B::print();
    d.C::print();
    cout << "sizeof(D):" << sizeof(D) << endl;

    return 0;
}

